package net.toby200;

import java.io.File;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;


public class NoticeDaoGenerator {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1000, "net.toby200.canalbuddy.notices.dao");

        addNotice(schema);
        File f = new File("test.txt");
        System.out.println(f.getAbsolutePath());

        new DaoGenerator().generateAll(schema, "app/src-gen-dao");
    }

    private static void addNotice(Schema schema) {

        Entity notice = schema.addEntity("Notice");
        /*
        private String title;
        private String waterway;
        private String fromDate;
        private String toDate;
        private String type;
        private String description;
        private String locationDetail;
        private Location startLoc;
        private Location endLoc;
        private long lastUpdated;
        */
        notice.addIdProperty();
        notice.addStringProperty("title").notNull();
        notice.addStringProperty("waterway").notNull();
        notice.addStringProperty("fromDate").notNull();
        notice.addStringProperty("toDate").notNull();
        notice.addStringProperty("type").notNull();
        notice.addStringProperty("description").notNull();
        notice.addStringProperty("locationDetail").notNull();
        notice.addDoubleProperty("startLocLat").notNull();
        notice.addDoubleProperty("startLocLng").notNull();
        notice.addDoubleProperty("endLocLat").notNull();
        notice.addDoubleProperty("endLocLng").notNull();
        notice.addLongProperty("lastUpdated").notNull();
    }


}

